/*******************************************OVERVIEW*******************************************************
 
 Political Shocks and Asset Prices
 
 Replication do file
 
Figure 1: Average Volatility Ratios
 
 Version July 9 2021 
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 


cd "/Users/ssaiegh/Files/Mac/UCSD/Carnahan/Shocks/Replication Files";

/*Create Log File*/;

log using "Figure 1", replace text;


/*Load Data File*/;


use "results_sp_argentina_2020.dta";

/*Produce Graph*/;


keep if event==1 | F.event==1;

collapse (mean) meanfu=ratio_nom (sem) sdfu=ratio_nom, by(event);
generate hifu = meanfu + 1.367472 *(sdfu);
generate lofu = meanfu -2.122311 *(sdfu);

twoway (bar meanfu event) (rcap hifu lofu event);
graph save Graph "fig1a.gph",replace;

use "results_sp_argentina_2020.dta", clear;

keep if event==1 | F.event==1;

drop if year==1967;

collapse (mean) meanfu=ratio_inf (sem) sdfu=ratio_inf, by(event);
generate hifu = meanfu + 1.157809 *(sdfu);
generate lofu = meanfu -2.800537 *(sdfu);

twoway (bar meanfu event) (rcap hifu lofu event);
graph save Graph "fig1b.gph",replace;

use "results_sp_argentina_2020.dta", clear;

keep if event==1 | F.event==1;

drop if year==1967;

collapse (mean) meanfu=ratio_dol (sem) sdfu=ratio_dol, by(event);
generate hifu = meanfu + 1.280114 *(sdfu);
generate lofu = meanfu - 2.267019 *(sdfu);

twoway (bar meanfu event) (rcap hifu lofu event);
graph save Graph "fig1c.gph",replace;

graph combine 
		    "fig1a.gph"
		    "fig1b.gph"
		    "fig1c.gph"
		    ,col(3) iscale(.75);

graph save Graph "figure1.gph",replace;			
		

log c;

